home *** CD-ROM | disk | FTP | other *** search
/ CD Loisirs 6 / CDL_N6.iso / mac / CD Loisirs N°6 / PaperPlanes / Paper Planes / Shared.dxr / 01030_button methods.ls < prev    next >
Encoding:
Text File  |  1994-08-25  |  1.4 KB  |  63 lines

  1. on buttonDown theSprite, normal, hilite
  2.   global DownOn
  3.   set DownOn to the clickOn
  4.   set the castNum of sprite theSprite to hilite
  5.   puppetSound("mouse down")
  6.   updateStage()
  7.   set reHilite to 0
  8.   repeat while the mouseDown
  9.     if not rollOver(DownOn) then
  10.       if not reHilite then
  11.         set the castNum of sprite theSprite to normal
  12.         updateStage()
  13.         set reHilite to 1
  14.       end if
  15.       next repeat
  16.     end if
  17.     if reHilite then
  18.       set the castNum of sprite theSprite to hilite
  19.       updateStage()
  20.       set reHilite to 0
  21.     end if
  22.   end repeat
  23.   wait(3)
  24.   set the castNum of sprite theSprite to normal
  25.   updateStage()
  26. end
  27.  
  28. on buttonUp theSprite
  29.   global DownOn
  30.   if rollOver(DownOn) then
  31.     puppetSound("mouse up")
  32.     updateStage()
  33.     return 1
  34.   else
  35.     return 0
  36.   end if
  37. end
  38.  
  39. on stickyButtonDown theSprite, normal, hilite
  40.   global DownOn
  41.   set DownOn to the clickOn
  42.   set the castNum of sprite theSprite to hilite
  43.   puppetSound("mouse down")
  44.   updateStage()
  45.   set reHilite to 0
  46.   repeat while the mouseDown
  47.     if not rollOver(DownOn) then
  48.       if not reHilite then
  49.         set the castNum of sprite theSprite to normal
  50.         updateStage()
  51.         set reHilite to 1
  52.       end if
  53.       next repeat
  54.     end if
  55.     if reHilite then
  56.       set the castNum of sprite theSprite to hilite
  57.       updateStage()
  58.       set reHilite to 0
  59.     end if
  60.   end repeat
  61.   wait(3)
  62. end
  63.